/*************************************************************************
> File Name: constructor.cpp
> Author: hzy
> Created Time: 2023-08-08 20:30:26
> Description:
************************************************************************/
#include <iostream>

using namespace std;

class Stu
{
public:
    Stu()
    {
        cout << "Stu()" << endl;
    }
    Stu(int myid, int myage)
    {
        cout << "Stu(int,int)" << endl;
        id = myid;
        age = myage;
    }

    void show();

private:
    int id;
    int age;

};

void Stu::show()
{
    cout << "id = " << id << ", age =" << age << endl;
}

int main()
{
    Stu stu(1, 22);
    stu.show();

    Stu stu1;
    stu1.show();

    return 0;
}